<?php
//require_once 'config.php';
require_once 'lib/oauth/EpiCurl.php';
require_once 'lib/oauth/EpiOAuth.php';
require_once 'lib/oauth/EpiTwitter.php';

/**
 * 
 * @author Panthro
 *
 */
class LoginInformation extends EpiTwitter {
	private $Config;
	public $userInfo;
		
	/**
	 * 
	 * @param $twitterUser
	 * @param $twitterPassword
	 */
	function __construct( ){
		parent::__construct();

		if(isset($_GET["oauth_token"])){
			$this->setToken($_GET["oauth_token"]);
			$this->token = $this->getAccessToken();
			$this->setToken($this->token->oauth_token, $this->token->oauth_token_secret);
			$this->userInfo = $this->get_accountVerify_credentials();
			$this->userInfo->response;
			$this->authorizeLink = $this->getAuthorizationUrl();
		}
	}
	
	
	function doLogin(){
		if($this->token == NULL){
			echo $this->getAuthorizationUrl();
		}else{
			//here is placed the code if the url provides an valid oauthToken.
			echo "Your twitter username is <strong>{$this->userInfo->screen_name}</strong> and your profile picture is <img src=\"{$this->userInfo->profile_image_url}\">";
		}
	}

}

	$objLoginInformation = new LoginInformation();
	$objLoginInformation->doLogin();
	

